﻿using KayakMes.Check.Application.Input;
using KayakMes.Check.Application.OUT;
using KayakMes.Check.Application.Quotation;
using KayakMes.Check.Domain;
using KayakMes.Common.Result;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Yitter.IdGenerator;

namespace KayakMes.Check.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class QuotaionController : ControllerBase
    {
        private readonly IQuotationService _quotationService;
        public QuotaionController(IQuotationService quotationService)
        {
            _quotationService = quotationService;
        }

        /// <summary>
        /// 添加报价
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        /// 
        [HttpPost]
        public ApiResult<int> AddQuotation(AddQuotationinput input)
        {
          return _quotationService.AddQuotation(input);
        }
        /// <summary>
        /// 获取所有报价
        /// </summary>
        /// <param name="input">查询参数</param>
        /// <returns>分页结果</returns>
        /// 
        [HttpGet]
        public ApiPaging<QuotationOut> GetAllQuotation([FromQuery]QuotationInput input)
        {
            return _quotationService.GetAllQuotation(input);
        }
        /// <summary>
        /// 获取报价详情
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        /// 
        [HttpGet]
        public ApiResult<QuotationModel> QuotationModel(long Id)
        {
           return _quotationService.QuotationModel(Id);
        }

    }
}
